<template>
	<view>
		<view>
			<table-title :content="contractName"></table-title>
			<view style="display: flex;align-items: center;justify-content: center;font-size: 30rpx;">更改历史记录</view>
			<view style="display: flex;justify-content: center;">
				<change-history :changeHistoryList="changeHistoryList"></change-history>
			</view>
		</view>
		<u-tabbar v-model="current" :list="list" :before-switch="clickTabbar"></u-tabbar>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				contractName: '房屋租赁合同',
				changeHistoryList:[
					{'type':'firstCanvas','time':'2021年01月01日'},
					{'type':'middleCanvas','time':'2020年02月02日'},
					{'type':'middleCanvas','time':'2020年03月03日'},
					{'type':'middleCanvas','time':'2020年04月04日'},
					{'type':'lastCanvas','time':'2020年05月05日'}
				],
				list: [
					{
						iconPath: "home",
						selectedIconPath: "home-fill",
						text: '首页',
						customIcon: false,
					},
					{
						iconPath: "photo",
						selectedIconPath: "photo-fill",
						text: '管家',
						customIcon: false,
					},
					{
						iconPath: "https://cdn.uviewui.com/uview/common/min_button.png",
						selectedIconPath: "https://cdn.uviewui.com/uview/common/min_button_select.png",
						text: '发现',
						customIcon: false,
					},
					{
						iconPath: "play-right",
						selectedIconPath: "play-right-fill",
						text: '消息',
						count: 23,
						customIcon: false,
					},
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '我的',
					},
				],
				current: 0
			}
		},
		methods: {
			clickTabbar(index) {
				switch(index){
					case 0:
						console.log('首页')
						uni.redirectTo({
							url:'/pages/home/home'
						})
						return true
						break
					case 1:
						console.log('管家')
						return true
						break
					case 2:
						console.log('发现')
						return true
						break
					case 3:
						console.log('消息')
						uni.redirectTo({
							url:'/pages/systemAnnoucement/list/list'
						})
						return true
						break
					case 4:
						console.log('我的')
						uni.navigateTo({
							url:'/pages/myPage/myPage'
						})
						return true
						break
				}
			},
		},
	}
</script>

<style>
</style>
